/*
 *  WaveTableFactory.h
 *  SoundController0002
 *
 *  Created by jiro on 10/06/29.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include "WaveTable.h"
#include "SineWaveTable.h"
#include "ConstantWaveTable.h"
#include "NullWaveTable.h"
#include "WaveTableWithArray.h"
#include "WaveTableWithWaveFunction.h"
#include "WaveFunctionFactory.h"
#include "AllExceptions.h"
#include <vector>

namespace sc 
{
	class WaveTableFactory 
	{
	private:
	
		static std::vector< const WaveTable* > waveTables;
		
		static std::vector< std::vector< double > > valuesVector;

	public:

		static const WaveTable& Create( WaveTable::Type type, double frequency, double adjuster = 1.0, double phaseShift = 0.0 );		

		static const WaveTable& CreateSin( double frequency, double phaseShift, double adjuster );

		static const WaveTable& Create( const WaveTable& waveTable, double adjuster );
		
		static const WaveTable& Create( const WaveFunction& function, double adjuster );

		static const WaveTable* Get( const WaveTable& table );

		static bool IsExist( const WaveTable& table );

	};

}